package com.demo.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.demo.domain.Qco.PageQco;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import java.util.Date;

/**
 * @author gxd
 * @since 2025/5/27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "sys_user", autoResultMap = true)
@ApiModel(description = "用户表 实体类")
public class SysUser extends PageQco {

    @ApiModelProperty(value = "用户Id")
    @TableId(type = IdType.ASSIGN_ID)
    private String userId;

    @ApiModelProperty(value = "部门Id")
    private String deptId;

    @ApiModelProperty(value = "用户账号")
    @NotEmpty(message = "用户账号不能为空")
    private String userName;

    @ApiModelProperty(value = "用户昵称")
    @NotEmpty(message = "用户昵称不能为空")
    private String nickName;

    @ApiModelProperty(value = "用户类型")
    private String userType;

    @ApiModelProperty(value = "用户邮箱")
    private String email;

    @ApiModelProperty(value = "手机号码")
    @TableField(value = "phonenumber")
    private String phoneNumber;

    @ApiModelProperty(value = "用户性别")
    private String sex;

    @ApiModelProperty(value = "用户性别")
    @TableField(exist = false)
    private String sexMc;

    @ApiModelProperty(value = "头像地址")
    private String avatar;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "账户状态")
    private String status;

    @ApiModelProperty(value = "删除标识")
    private String delFlag;

    @ApiModelProperty(value = "删除标识Mc")
    @TableField(exist = false)
    private String delFlagMc;

    @ApiModelProperty(value = "最后登录Ip")
    private String loginIp;

    @ApiModelProperty(value = "最后登录时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date loginDate;

    @ApiModelProperty(name = "createBy", value = "创建人")
    @TableField(value = "CREATE_BY", fill = FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty(name = "createMc", value = "创建Mc")
    @TableField(exist = false)
    private String createMc;

    @ApiModelProperty(name = "createTime", value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(name = "updateBy", value = "修改人")
    @TableField(value = "UPDATE_BY", fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    @ApiModelProperty(name = "updateMc", value = "修改Mc")
    @TableField(exist = false)
    private String updateMc;

    @ApiModelProperty(name = "updateTime", value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "UPDATE_TIME", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "部门名称")
    @TableField(exist = false)
    private String deptName;

    @ApiModelProperty(value = "用户昵称拼音")
    private String pinyin;

    @ApiModelProperty(value = "用户昵称拼音首字母")
    private String pinyinSort;
}
